<template>
  <div id="homepie" style="width:400ox;height:200px"></div>
</template>

<script>
export default {
  name:'HomePie',
  component:{},
  methods:{},
  mounted(){
    const myCharts = echarts.init(document.getElementById('homepie'))
    const pieData = [
      {name:'赘婿',value:1200},
      {name:'战狼',value:3000},
      {name:'王牌对王牌',value:2000},
      {name:'斗罗大陆',value:1800},
      {name:'熊出没',value:1000},
      {name:'野外生存2',value:999}
    ]
    const option = {
      series:[
        {
          type:'pie',
          data:pieData,
          label:{
            show:true,
            formatter:function(arg){
            return arg.name + '热播' +arg.value +'次\n' +arg.percent +'%'
            }
          },
          selectedMode:'single'
        }
      ]
    }
    myCharts.setOption(option)
  }
}
</script>

<style scoped>

</style>